import request from '@/utils/request'

// 获取会议室列表
export const getConferenceRoomList = (params) => {
  return request({
    url: '/v1/room',
    method: 'GET',
    params
  })
}

// 创建会议室
export const createConferenceRoom = (data) => {
  return request({
    url: '/v1/room',
    method: 'POST',
    data
  })
}

// 编辑会议室
export const editConferenceRoom = (data) => {
  return request({
    url: `/v1/room/${data.id}`,
    method: 'PUT',
    data
  })
}

// 删除会议室
export const deleteConferenceRoom = (id) => {
  return request({
    url: `/v1/room/${id}`,
    method: 'DELETE'
  })
}

// 获取今日及之后的预约列表
export const getReserveList = (params) => {
  return request({
    url: `/v1/room/day/list`,
    method: 'GET',
    params
  })
}

// 获取预约记录
export const getReserveRecords = (params) => {
  return request({
    url: `/v1/room/reservation`,
    method: 'GET',
    params
  })
}

// 获取预约详情
export const getConferenceRoomReserveDetail = (id) => {
  return request({
    url: `/v1/room/reservation/${id}`,
    method: 'GET'
  })
}

// 预约时间冲突校验
export const checkReservationTime = (params) => {
  return request({
    url: `/v1/room/reservation/conflict/time`,
    method: 'GET',
    params
  })
}

// 编辑预约
export const editReservation = (data) => {
  return request({
    url: `/v1/room/reservation/${data.id}`,
    method: 'POST',
    data
  })
}

// 获取会议预约二维码
export const getReserveQrCode = (params) => {
  return request({
    url: `/v1/room/reserve/qrcode`,
    method: 'GET',
    params
  })
}

// 获取日程列表
export const getScheduleList = (params) => {
  return request({
    url: `/v1/room/appointment/record/date`,
    method: 'GET',
    params
  })
}

// 预约会议室
export const reservationMeetingRoom = (data) => {
  return request({
    url: `/v1/room/reservation`,
    method: 'POST',
    data
  })
}
